package com.model
{
	import com.rubenswieringa.containers.SuperViewStack;
	
	import flash.display.DisplayObject;
	
	public class InteractiveViewStack extends SuperViewStack
	{
		public function InteractiveViewStack()
		{
			super();
		}
		
		public override function addChildAt(child:DisplayObject, index:int):DisplayObject {
			if(child is InteractivePage) {
				var page:InteractivePage = InteractivePage(child);
				//page.loadContents();
			} else {
				var x:int = 6;
			}
			return super.addChildAt(child, index);
		}
		
		public override function removeChild(child:DisplayObject):DisplayObject {
			var page:InteractivePage = InteractivePage(child);
			page.unloadContents();
			return super.removeChild(child); 
		}

	}
}